<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>定时推送管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- 确保适当的绘制和触屏缩放 -->
    <link rel="stylesheet" href="{$url_css}bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="{$url_css}admin.css" type="text/css">
    <script type="text/javascript" src="{$url_js}jquery-1.12.0.min.js"></script>
</head>
<body>

<div class="container" style="width:96%">
    <table class="table table-bordered table-striped table-hover" align="center">
        <thead>
        <tr>
            <td width="5%">ID</td>
            <td width="5%">类型</td>
            <td>数据</td>
            <td width="100px">状态</td>
            <td width="160px">推送时间</td>
            <td width="160px">添加时间</td>
            <td width="70px">操作</td>
        </tr>
        </thead>
        <tbody>
            {if !empty($list)}
                {foreach from=$list item=item}
                    <tr>
                        <td>{$item.CronId}</td>
                        <td>
                            {if $item.Type == 1}
                                推送
                            {else}
                                其他
                            {/if}
                        </td>
                        <td>{$item.CronData|html|truncate:210:"...":true}</td>
                        <td>
                            {if $item.Status == 1}
                                <span style="color:green">已发送</span>
                            {elseif $item.Status == 2}
                                <span style="color:red">发送失败</span>
                            {else}
                                待发送
                            {/if}
                        </td>
                        <td>{$item.CronTime|html}</td>
                        <td>{$item.CreateTime|html}</td>
                        <td>
                            {if $item.Status == '0'}
                            <a class="btn btn-danger delete delete_btn" href="?do=delete&id={$item.CronId}" _id="{$item.CronId}">删除</a>
                            {/if}
                        </td>
                    </tr>
                {/foreach}
            {/if}
            {if $pagination != ''}
                <tr><td colspan="6">{$pagination}</td></tr>
            {/if}
        </tbody>
    </table>
</div>

{literal}
<script>

//删除
$(".delete_btn").click(function(){
    var url = self.location.pathname + $(this).attr("href");
    top.__confirm('确定要删除吗？','删除后不可恢复！', url, self);
    return false;
});
</script>
{/literal}
</body>
<html>